/*
 * =====================================================================================
 *
 *       Filename:  AliveServer.h
 *
 *    Description:  this is a class to send alive to ptu (header file)
 *
 *        Version:  1.0
 *        Created:  2012年03月05日 10时48分18秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (),
 *        Company:
 *
 * =====================================================================================
 */

#ifndef ALIVE_SERVER_H
#define ALIVE_SERVER_H

#include "publicFun.h"
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>


class AliveServer
{
public:
    AliveServer();
    virtual ~AliveServer();

    virtual void Service()=0;
    void HeartBeat();
    bool IsTimeout(time_t compareTime,int timeoutSec);
    void SetHeartBeatEnable(bool enable);
    bool HeartBeatEnable() const;
    int SendUsrSig(pid_t pid,SigTag sigTag) const;


private:
    bool mbHeartBeat;
    int mPPid;
    volatile time_t startTime;

};
#endif
